package com.bwie.controller;

import com.bwie.common.domain.Login;
import com.bwie.common.result.Result;
import com.bwie.service.LoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author：Minxiao Hao
 * @Description:
 * @name：LoginController
 * @Date：2024/11/4 9:59
 */
@RestController
@RequestMapping("/login")
public class LoginController {
    @Autowired
    private LoginService loginService;

    /**
     * 根据手机号获取用户 对象
     * @param loginPhone
     * @return
     */
    @PostMapping("/findLoginPhone/{loginPhone}")
    public Result findLoginPhone(@PathVariable String loginPhone){
        Login login = loginService.findLoginPhone(loginPhone);
        Result result = Result.success(login);
        return result;
    }
}
